package com.keien.kleidianplan;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class MainActivity extends Activity {
	private MyDBHelper dbhelper;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
		Intent aIntent = new Intent(MainActivity.this,MusicService.class);
		startService(aIntent);
		dbhelper = new MyDBHelper(getApplicationContext());
		dbhelper.getWritableDatabase();
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		Intent aIntent = new Intent(MainActivity.this,MusicService.class);
		stopService(aIntent);
		super.onStop();
		Log.d("onStop", "onStop");
	}
	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		Intent aIntent = new Intent(MainActivity.this,MusicService.class);
		stopService(aIntent);
		Log.d("pause", "pause");
	}
	
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		Intent aIntent = new Intent(MainActivity.this,MusicService.class);
		startService(aIntent);
		super.onResume();
		Log.d("onResume", "onResume");
	}

}
